// 封装与购物车相关的接口函数
import http from "@/utils/http"
// 添加购物车数据接口
export const addCartAPI = (data: any) => {
    return http({
        url: "/api/cart/add",
        method: "post",
        data
    })
}
// 查询购物车数据接口
export const getCartListAPI  = (data: any) => {
    return http({
        url: "/api/cart/list",
        method: "post",
        data
    })
}
// 清空购物车数据接口
export const clearAllCartAPI   = (data: any) => {
    return http({
        url: "/api/cart/removeall",
        method: "post",
        data
    })
}

// 删除单条购物车数据

export const  removeCartAPI   = (data: any) => {
    return http({
        url: "/api/cart/remove",
        method: "post",
        data
    })
}

//更新购物车商品数量接口

export const updateCartNumAPI = (data: any) => {
    return http({
        url: "/api/cart/updatenum",
        method: "post",
        data
    })
}

//更新所有购物车数据的选中

export const changeCartSelectAPI = (data: any) => {
    return http({
        url: "/api/cart/selectone",
        method: "post",
        data
    })
}